package com.example.startup.manager

import com.example.startup.Result
import com.example.startup.StartUp
import com.example.startup.sort.key
import java.util.concurrent.ConcurrentHashMap


/**
 * 缓存任务执行完的结果
 */
object StartUpCacheManager {
    private val startUpMap = ConcurrentHashMap<key, Result<*>>()

    fun saveResult(startUp: key, result: Result<*>) {
        startUpMap[startUp] = result
    }

    fun getResult(startUp: key): Result<*>? {
        return startUpMap[startUp]
    }

}